use crate::commands::{self, Command};
use crate::Result;

use clap::{command, Parser};
#[derive(Parser)]
#[command(version, about, long_about = None)]
pub struct PngArgs {
    /// Optional name to operate on
    #[command(subcommand)]
    pub command: Command,
}
pub async  fn run() -> Result<()> {
    let args = crate::args::PngArgs::parse();
    match args.command {
        Command::Encode(encode_args) => encode_args.encode().await?,
        Command::Decode(decode_args) => decode_args.decode().await?,
        Command::Remove(remove_args) => remove_args.remove().await?,
        Command::Print { file } => commands::print(file).await?,
    }
    Ok(())
}
